using System;
using System.Collections.Generic;
using System.Drawing;
using System.ComponentModel;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace GURUCORE.Portal.AspNet.Control
{
    /// <summary>
    /// Tipper control, help you displaying some extra info on website when user hover on.
    /// put Tipper.js in to js/Tipper.js
    /// create CSS class name = TipperWindow
    /// put on javascript handler on tag you need to tipper, for example 
    /// <span 
    /// onmouseover="showTipper('PopUp', this, 0, 20);"  
    /// onmouseout="hideTipper('PopUp');">  	
    /// 
    /// onmouseover="showTipper('<%=Tipper1.ClientID%>', this, -130, -15, '<%#DataBinder.Eval(Container.DataItem,"Subject")%>' , '<%#DataBinder.Eval(Container.DataItem,"ContactName")%>' , '<%#DataBinder.Eval(Container.DataItem,"ContactPhone")%>');"  onmouseout="hideTipper('<%=Tipper1.ClientID%>');"	>
    /// PopUp is Tipper ClientID
    /// </summary>
    [DefaultProperty("Source"),
    ToolboxData("<{0}:Tipper runat=server></{0}:Tipper>")]
    [ToolboxBitmap(typeof(TextBoxS), "resGURUCORE.ico")]
    [Description("Tooltip (obsoleted) ")]
    public class Tipper : Literal
    {
        private string cssclass;
        private string width;
        private string height;

        /// <summary>
        /// Default CSS class name for the tipper is .TipperWindow.
        /// </summary>
        [Bindable(true),
        Category("Appearance"),
        DefaultValue("TipperWindow")]

        public string CssClass
        {
            get
            {
                return cssclass;
            }

            set
            {
                cssclass = value;
            }
        }


        [Bindable(true),
        Category("Appearance"),
        DefaultValue("200")]
        public string Width
        {
            get
            {
                return width;
            }

            set
            {
                width = value;
            }
        }


        [Bindable(true),
        Category("Appearance"),
        DefaultValue("200")]
        public string Height
        {
            get
            {
                return height;
            }

            set
            {
                height = value;
            }
        }


        /// <summary> 
        /// Render this control to the output parameter specified.
        /// </summary>
        /// <param name="output"> The HTML writer to write out to </param>
        protected override void Render(HtmlTextWriter output)
        {
            base.Text = "<div id=" + base.ClientID + "  class=\"" + cssclass + "\" width=\"" + width + "\" height=\"" + height + "\">"
                + base.Text
                + "</div>"
                + "<script language=\"JavaScript\" src=\"js/Tipper.js\"></script>"
                ;

            base.Render(output);
        }

    }	// end class
}
